﻿CREATE PROCEDURE [dbo].[proc_L_Reimbursement_Assets_GetListByItemId]
	(		
		@itemid int
	)
AS
begin
SELECT ROW_NUMBER() OVER (ORDER BY id  ) AS Row,a.Id,
	a.GId,
	a.CategoryId,
	(Select Title From Assets_Categorys Where Id=a.CategoryId) As CategoryName,
	NameId,
	(Select Title From Assets_Names Where Id=a.NameId) As NameTitle,
	Description,
	CompanyId,
	(Select CompanyName From Company Where Id=a.CompanyId) As CompanyName,
	UserName,
	EName,
	StateId,
	(Select Title From Assets_States Where Id=a.StateId) As StateName,
	Prices,
	DJUserName,
	DJDate,
	GGXH,
	GZDate,
	IsNULL(IsApplyBf,0) AS IsApplyBf,
	ANumber,
	IsNull(LyDate,'1900-01-01') as LyDate,
(case isnull(typeid,0) when 1 then '固定公用类' when 2 then '分配使用类' when 3 then '耗材低值类'  end) as typename

	 FROM L_Reimbursement_Assets as a WHERE itemid=@itemid
		
end
	RETURN
